﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using CarlosAg.ExcelXmlWriter;

namespace ONTS.WEB
{
    public class ExcelStyle
    {
        public static void BOT_StyleConfiguration(Workbook book)
        {
            WorksheetStyle s31 = book.Styles.Add("header");
            s31.Font.FontName = "Tahoma";
            s31.Font.Size = 10;
            s31.Font.Color = "#000000";
            s31.Font.Bold = true;
            s31.Alignment.Horizontal = StyleHorizontalAlignment.Center;
            s31.Alignment.Vertical = StyleVerticalAlignment.Center;
            s31.Alignment.WrapText = true;
            s31.NumberFormat = "@";

            WorksheetStyle headernotbold = book.Styles.Add("headernotbold");
            headernotbold.Font.FontName = "Tahoma";
            headernotbold.Font.Size = 10;
            headernotbold.Font.Color = "#000000";
            headernotbold.Font.Bold = false;
            headernotbold.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            headernotbold.Alignment.Vertical = StyleVerticalAlignment.Center;
            headernotbold.Alignment.WrapText = true;
            headernotbold.NumberFormat = "@";

            WorksheetStyle header_right = book.Styles.Add("header_right");
            header_right.Font.FontName = "Tahoma";
            header_right.Font.Size = 10;
            header_right.Font.Color = "#000000";
            header_right.Font.Bold = true;
            header_right.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            header_right.Alignment.Vertical = StyleVerticalAlignment.Top;
            header_right.Alignment.WrapText = true;
            header_right.NumberFormat = "@";

            WorksheetStyle body = book.Styles.Add("body");
            body.Font.FontName = "Tahoma";
            body.Font.Size = 10;
            body.Font.Color = "#000000";
            body.Font.Bold = false;
            body.Alignment.Horizontal = StyleHorizontalAlignment.Center;
            body.Alignment.Vertical = StyleVerticalAlignment.Top;
            body.Alignment.WrapText = true;
            body.NumberFormat = "@";
            body.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
            body.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            body.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            body.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);

            WorksheetStyle bodyleft = book.Styles.Add("bodyleft");
            bodyleft.Font.FontName = "Tahoma";
            bodyleft.Font.Size = 10;
            bodyleft.Font.Color = "#000000";
            bodyleft.Font.Bold = false;
            bodyleft.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            bodyleft.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodyleft.Alignment.WrapText = true;
            bodyleft.NumberFormat = "@";
            bodyleft.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
            bodyleft.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            bodyleft.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            bodyleft.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);

            WorksheetStyle bodynoborderright = book.Styles.Add("bodynoborderright");
            bodynoborderright.Font.FontName = "Tahoma";
            bodynoborderright.Font.Size = 10;
            bodynoborderright.Font.Color = "#000000";
            bodynoborderright.Font.Bold = false;
            bodynoborderright.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            bodynoborderright.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodynoborderright.Alignment.WrapText = true;
            bodynoborderright.NumberFormat = "@";

            WorksheetStyle bodynoborderleft = book.Styles.Add("bodynoborderleft");
            bodynoborderleft.Font.FontName = "Tahoma";
            bodynoborderleft.Font.Size = 10;
            bodynoborderleft.Font.Color = "#000000";
            bodynoborderleft.Font.Bold = false;
            bodynoborderleft.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            bodynoborderleft.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodynoborderleft.Alignment.WrapText = true;
            bodynoborderleft.NumberFormat = "@";

            WorksheetStyle bodynoborder = book.Styles.Add("bodynoborder");
            bodynoborder.Font.FontName = "Tahoma";
            bodynoborder.Font.Size = 10;
            bodynoborder.Font.Color = "#000000";
            bodynoborder.Font.Bold = false;
            bodynoborder.Alignment.Horizontal = StyleHorizontalAlignment.Center;
            bodynoborder.Alignment.Vertical = StyleVerticalAlignment.Bottom;
            bodynoborder.Alignment.WrapText = true;
            bodynoborder.NumberFormat = "@";

        }

        public static void ImageStyles(int[,] arr, Workbook book)
        {
            int i = 0;
            int[] k;
            int[] s;
            k = new int[arr.GetUpperBound(0) * arr.GetUpperBound(1)];

            for (int x = 0; x < arr.GetUpperBound(0); x++)
            {
                for (int y = 0; y < arr.GetUpperBound(1); y++)
                {
                    k[i++] = arr[x, y];
                }
            }

            s = k.Distinct().ToArray();
            for (i = 0; i < s.Length; i++)
            {
                WorksheetStyle style = new WorksheetStyle(ColorTranslator.ToHtml(Color.FromArgb(s[i])));
                style.Interior.Color = ColorTranslator.ToHtml(Color.FromArgb(s[i]));
                style.Interior.Pattern = StyleInteriorPattern.Solid;
                book.Styles.Add(style);
            }
        }

        public static WorksheetCell GetCell(int[,] arr)
        {
            var cell = new WorksheetCell();
            for (int y = 0; y < arr.GetUpperBound(1); y++)
            {
                for (int x = 0; x < arr.GetUpperBound(0); x++)
                {
                     cell = new WorksheetCell("", ColorTranslator.ToHtml(Color.FromArgb(arr[x, y])));
                }
            }
            return cell;   
        }
        
        public static void Header(Workbook book)
        {

            WorksheetStyle s31 = book.Styles.Add("header");
            s31.Font.FontName = "Tahoma";

            s31.Font.Size = 10;
            s31.Font.Color = "#000000";
            s31.Font.Bold = true;
            s31.Alignment.Horizontal = StyleHorizontalAlignment.Center;
            s31.Alignment.Vertical = StyleVerticalAlignment.Center;
            s31.Alignment.WrapText = true;
            s31.NumberFormat = "@";


        }

        public static void Grey_Cen_Bold_Top_Botton(Workbook book)
        {

            WorksheetStyle s31 = book.Styles.Add("Grey_Cen_Bold_Top_Botton");
            s31.Font.FontName = "Tahoma";
            s31.Interior.Color = "#343434";
            s31.Interior.Pattern = StyleInteriorPattern.Solid;
            s31.Font.Size = 10;
            s31.Font.Color = "#00ff0b";
            s31.Font.Bold = true;
            s31.Alignment.Horizontal = StyleHorizontalAlignment.Center;
            s31.Alignment.Vertical = StyleVerticalAlignment.Top;
            s31.Alignment.WrapText = true;
            s31.NumberFormat = "@";
            s31.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
            s31.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            s31.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            s31.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);
        }

        public static void Grey_Right_Bold_Top_Botton(Workbook book)
        {

            WorksheetStyle s31 = book.Styles.Add("Grey_Right_Bold_Top_Botton");
            s31.Font.FontName = "Tahoma";
            s31.Interior.Color = "#343434";
            s31.Interior.Pattern = StyleInteriorPattern.Solid;
            s31.Font.Size = 10;
            s31.Font.Color = "#00ff0b";
            s31.Font.Bold = true;
            s31.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            s31.Alignment.Vertical = StyleVerticalAlignment.Top;
            s31.Alignment.WrapText = true;
            s31.NumberFormat = "@";
            s31.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
            s31.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            s31.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            s31.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);
        }

        public static void Grey_Cen_Top_Botton(Workbook book)
        {

            WorksheetStyle s31 = book.Styles.Add("Grey_Cen_Top_Botton");
            s31.Font.FontName = "Tahoma";
            s31.Interior.Color = "#343434";
            s31.Interior.Pattern = StyleInteriorPattern.Solid;
            s31.Font.Size = 10;
            s31.Font.Color = "#00ff0b";
            s31.Font.Bold = false;
            s31.Alignment.Horizontal = StyleHorizontalAlignment.Center;
            s31.Alignment.Vertical = StyleVerticalAlignment.Top;
            s31.Alignment.WrapText = true;
            s31.NumberFormat = "@";
            s31.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
            s31.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            s31.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            s31.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);
        }

        public static void Grey_Right_NoBoder(Workbook book)
        {

            WorksheetStyle s31 = book.Styles.Add("Grey_Right_NoBoder");
            s31.Font.FontName = "Tahoma";
            s31.Interior.Color = "#343434";
            s31.Interior.Pattern = StyleInteriorPattern.Solid;
            s31.Font.Size = 10;
            s31.Font.Color = "#00ff0b";
            s31.Font.Bold = false;
            s31.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            s31.Alignment.Vertical = StyleVerticalAlignment.Top;
            s31.Alignment.WrapText = true;
            s31.NumberFormat = "@";
        }

        public static void Header_Center_Border(Workbook book)
        {
            WorksheetStyle headercenborder = book.Styles.Add("headercenborder");
            headercenborder.Font.FontName = "Tahoma";
            headercenborder.Font.Size = 10;
            headercenborder.Font.Color = "#000000";
            headercenborder.Font.Bold = true;
            headercenborder.Alignment.Horizontal = StyleHorizontalAlignment.Center;
            headercenborder.Alignment.Vertical = StyleVerticalAlignment.Center;
            headercenborder.Alignment.WrapText = true;
            headercenborder.NumberFormat = "@";
            headercenborder.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
            headercenborder.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            headercenborder.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            headercenborder.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);
        }

        public static void Header_Left_NoBorder(Workbook book)
        {
            WorksheetStyle headerleft = book.Styles.Add("headerleft");
            headerleft.Font.FontName = "Tahoma";
            headerleft.Font.Size = 10;
            headerleft.Font.Color = "#000000";
            headerleft.Font.Bold = true;
            headerleft.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            headerleft.Alignment.Vertical = StyleVerticalAlignment.Center;
            headerleft.Alignment.WrapText = true;
            headerleft.NumberFormat = "@";
        }

        public static void Header_Left_Border(Workbook book)
        {

            WorksheetStyle headerborderleft = book.Styles.Add("headerborderleft");
            headerborderleft.Font.FontName = "Tahoma";
            headerborderleft.Font.Size = 10;
            headerborderleft.Font.Color = "#000000";
            headerborderleft.Font.Bold = true;
            headerborderleft.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            headerborderleft.Alignment.Vertical = StyleVerticalAlignment.Center;
            headerborderleft.Alignment.WrapText = true;
            headerborderleft.NumberFormat = "@";
            headerborderleft.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
            headerborderleft.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            headerborderleft.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            headerborderleft.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);
        }

        public static void Header_Right_NoBorder(Workbook book)
        {
            WorksheetStyle headerright = book.Styles.Add("headerright");
            headerright.Font.FontName = "Tahoma";
            headerright.Font.Size = 10;
            headerright.Font.Color = "#000000";
            headerright.Font.Bold = true;
            headerright.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            headerright.Alignment.Vertical = StyleVerticalAlignment.Center;
            headerright.Alignment.WrapText = true;
            headerright.NumberFormat = "@";
        }

        public static void Header_FontNotBold_NoBorder(Workbook book)
        {
            WorksheetStyle headernotbold = book.Styles.Add("headernotbold");
            headernotbold.Font.FontName = "Tahoma";
            headernotbold.Font.Size = 10;
            headernotbold.Font.Color = "#000000";
            headernotbold.Font.Bold = false;
            headernotbold.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            headernotbold.Alignment.Vertical = StyleVerticalAlignment.Center;
            headernotbold.Alignment.WrapText = true;
            headernotbold.NumberFormat = "@";
        }

        public static void Header_Right(Workbook book)
        {
            WorksheetStyle header_right = book.Styles.Add("header_right");

            header_right.Font.FontName = "Tahoma";
            header_right.Font.Size = 10;
            header_right.Font.Color = "#000000";
            header_right.Font.Bold = true;
            header_right.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            header_right.Alignment.Vertical = StyleVerticalAlignment.Top;
            header_right.Alignment.WrapText = true;
            header_right.NumberFormat = "@";
        }

        public static void Body_Center_Border(Workbook book)
        {
            WorksheetStyle body = book.Styles.Add("body");
            body.Font.FontName = "Tahoma";
            body.Font.Size = 10;
            body.Font.Color = "#000000";
            body.Font.Bold = false;
            body.Alignment.Horizontal = StyleHorizontalAlignment.Center;
            body.Alignment.Vertical = StyleVerticalAlignment.Top;
            body.Alignment.WrapText = true;
            body.NumberFormat = "@";
            body.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
            body.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            body.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            body.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);
        }

        public static void Body_Left_Border(Workbook book)
        {
            WorksheetStyle bodyleft = book.Styles.Add("bodyleft");
            bodyleft.Font.FontName = "Tahoma";
            bodyleft.Font.Size = 10;
            bodyleft.Font.Color = "#000000";
            bodyleft.Font.Bold = false;
            bodyleft.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            bodyleft.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodyleft.Alignment.WrapText = true;
            bodyleft.NumberFormat = "@";
            bodyleft.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
            bodyleft.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            bodyleft.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            bodyleft.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);
        }

        public static void Body_Right_BorderDash(Workbook book)
        {
            WorksheetStyle bodysolid = book.Styles.Add("Body_Right_BorderDash");
            bodysolid.Font.FontName = "Tahoma";
            bodysolid.Font.Size = 10;
            bodysolid.Font.Color = "#000000";
            bodysolid.Font.Bold = false;
            bodysolid.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            bodysolid.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodysolid.Alignment.WrapText = true;
            bodysolid.NumberFormat = "@";
            bodysolid.Borders.Add(StylePosition.Bottom, LineStyleOption.Dash, 1);
            bodysolid.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Top, LineStyleOption.Dash, 1);
        }

        public static void Body_Left_BorderDash(Workbook book)
        {
            WorksheetStyle bodysolid = book.Styles.Add("Body_Left_BorderDash");
            bodysolid.Font.FontName = "Tahoma";
            bodysolid.Font.Size = 10;
            bodysolid.Font.Color = "#000000";
            bodysolid.Font.Bold = false;
            bodysolid.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            bodysolid.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodysolid.Alignment.WrapText = true;
            bodysolid.NumberFormat = "@";
            bodysolid.Borders.Add(StylePosition.Bottom, LineStyleOption.Dash, 1);
            bodysolid.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Top, LineStyleOption.Dash, 1);
        }

        public static void Body_Cen_BorderDash(Workbook book)
        {
            WorksheetStyle bodysolid = book.Styles.Add("Body_Cen_BorderDash");
            bodysolid.Font.FontName = "Tahoma";
            bodysolid.Font.Size = 10;
            bodysolid.Font.Color = "#000000";
            bodysolid.Font.Bold = false;
            bodysolid.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            bodysolid.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodysolid.Alignment.WrapText = true;
            bodysolid.NumberFormat = "@";
            bodysolid.Borders.Add(StylePosition.Bottom, LineStyleOption.Dash, 1);
            bodysolid.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Top, LineStyleOption.Dash, 1);
        }

        public static void Body_Right_BorderTop(Workbook book)
        {
            WorksheetStyle bodysolid = book.Styles.Add("Body_Right_BorderTop");
            bodysolid.Font.FontName = "Tahoma";
            bodysolid.Font.Size = 10;
            bodysolid.Font.Color = "#000000";
            bodysolid.Font.Bold = false;
            bodysolid.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            bodysolid.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodysolid.Alignment.WrapText = true;
            bodysolid.NumberFormat = "@";
            bodysolid.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);
        }

        public static void Body_Right_BorderBottom(Workbook book)
        {
            WorksheetStyle bodysolid = book.Styles.Add("Body_Right_BorderBottom");
            bodysolid.Font.FontName = "Tahoma";
            bodysolid.Font.Size = 10;
            bodysolid.Font.Color = "#000000";
            bodysolid.Font.Bold = false;
            bodysolid.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            bodysolid.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodysolid.Alignment.WrapText = true;
            bodysolid.NumberFormat = "@";
            bodysolid.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
        }

        public static void Body_Left_BorderTop(Workbook book)
        {
            WorksheetStyle bodysolid = book.Styles.Add("Body_Left_BorderTop");
            bodysolid.Font.FontName = "Tahoma";
            bodysolid.Font.Size = 10;
            bodysolid.Font.Color = "#000000";
            bodysolid.Font.Bold = false;
            bodysolid.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            bodysolid.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodysolid.Alignment.WrapText = true;
            bodysolid.NumberFormat = "@";
            bodysolid.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);
        }

        public static void Body_Left_BorderBottom(Workbook book)
        {
            WorksheetStyle bodysolid = book.Styles.Add("Body_Left_BorderBottom");
            bodysolid.Font.FontName = "Tahoma";
            bodysolid.Font.Size = 10;
            bodysolid.Font.Color = "#000000";
            bodysolid.Font.Bold = false;
            bodysolid.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            bodysolid.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodysolid.Alignment.WrapText = true;
            bodysolid.NumberFormat = "@";
            bodysolid.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            bodysolid.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
        }

        public static void Body_Right_NoBorder(Workbook book)
        {
            WorksheetStyle bodynoborderright = book.Styles.Add("bodynoborderright");
            bodynoborderright.Font.FontName = "Tahoma";
            bodynoborderright.Font.Size = 10;
            bodynoborderright.Font.Color = "#000000";
            bodynoborderright.Font.Bold = false;
            bodynoborderright.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            bodynoborderright.Alignment.Vertical = StyleVerticalAlignment.Top;
            bodynoborderright.Alignment.WrapText = true;
            bodynoborderright.NumberFormat = "@";
        }

        public static void Body_Left_NoBorder(Workbook book)
        {
            WorksheetStyle bodynoborderleft = book.Styles.Add("bodynoborderleft");
            bodynoborderleft.Font.FontName = "Tahoma";
            bodynoborderleft.Font.Size = 10;
            bodynoborderleft.Font.Color = "#000000";
            bodynoborderleft.Font.Bold = false;
            bodynoborderleft.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            bodynoborderleft.Alignment.Vertical = StyleVerticalAlignment.Center;
            bodynoborderleft.Alignment.WrapText = true;
            bodynoborderleft.NumberFormat = "@";
        }

        public static void Body_Center_NoBorder(Workbook book)
        {
            WorksheetStyle bodynoborder = book.Styles.Add("bodynoborder");
            bodynoborder.Font.FontName = "Tahoma";
            bodynoborder.Font.Size = 10;
            bodynoborder.Font.Color = "#000000";
            bodynoborder.Font.Bold = false;
            bodynoborder.Alignment.Horizontal = StyleHorizontalAlignment.Center;
            bodynoborder.Alignment.Vertical = StyleVerticalAlignment.Bottom;
            bodynoborder.Alignment.WrapText = true;
            bodynoborder.NumberFormat = "@";
        }

        public static void Footer_Right_Bold_Border(Workbook book)
        {
            WorksheetStyle s11 = book.Styles.Add("Footer_Right_Bold_Border");
            s11.Font.FontName = "Tahoma";
            s11.Font.Size = 10;
            s11.Font.Color = "#000000";
            s11.Font.Bold = true;
            s11.Alignment.Horizontal = StyleHorizontalAlignment.Right;
            s11.Alignment.Vertical = StyleVerticalAlignment.Top;
            s11.Alignment.WrapText = true;
            s11.NumberFormat = "@";
            s11.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
            s11.Borders.Add(StylePosition.Left, LineStyleOption.Continuous, 1);
            s11.Borders.Add(StylePosition.Right, LineStyleOption.Continuous, 1);
            s11.Borders.Add(StylePosition.Top, LineStyleOption.Continuous, 1);
        }

        public static void Footer_Left_Bold_NoBorder(Workbook book)
        {
            WorksheetStyle s11 = book.Styles.Add("Footer_Left_Bold_NoBorder");
            s11.Font.FontName = "Tahoma";
            s11.Font.Size = 10;
            s11.Font.Color = "#000000";
            s11.Font.Bold = true;
            s11.Alignment.Horizontal = StyleHorizontalAlignment.Left;
            s11.Alignment.Vertical = StyleVerticalAlignment.Top;
            s11.Alignment.WrapText = true;
            s11.NumberFormat = "@";
        }

        public static void Footer_bottomBorder(Workbook book)
        {
            WorksheetStyle s11 = book.Styles.Add("Footer_bottomBorder");

            s11.Borders.Add(StylePosition.Bottom, LineStyleOption.Continuous, 1);
            s11.NumberFormat = "@";
        }
    }
}